home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume11 / tinymud2 / part06 < prev    next >
Encoding:
Internet Message Format  |  1990-08-10  |  54.8 KB

  1. Path: uunet!ogicse!zephyr.ens.tek.com!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v11i010:  tinymud2 - user-extendible multi-user adventure (v1.5.4), Part06/10
  5. Message-ID: <6055@tekred.CNA.TEK.COM>
  6. Date: 30 Jul 90 16:45:48 GMT
  7. Sender: news@tekred.CNA.TEK.COM
  8. Lines: 1479
  9. Approved: billr@saab.CNA.TEK.COM
  10. Posted: Mon Jul 30 09:45:48 1990
  11.  
  12. Submitted-by: James Aspnes <asp@cs.cmu.edu>
  13. Posting-number: Volume 11, Issue 10
  14. Archive-name: tinymud2/Part06
  15. Supersedes: tinymud: Volume 8, Issue 80-83
  16.  
  17.  
  18.  
  19. #! /bin/sh
  20. # This is a shell archive.  Remove anything before this line, then unpack
  21. # it by saving it into a file and typing "sh file".  To overwrite existing
  22. # files, type "sh file -c".  You can also feed this as standard input via
  23. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  24. # will see the following message at the end:
  25. #        "End of archive 6 (of 10)."
  26. # Contents:  player.c set.c tiny.docs
  27. # Wrapped by billr@saab on Fri Jul 27 15:27:47 1990
  28. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  29. if test -f 'player.c' -a "${1}" != "-c" ; then 
  30.   echo shar: Will not clobber existing file \"'player.c'\"
  31. else
  32. echo shar: Extracting \"'player.c'\" \(1801 characters\)
  33. sed "s/^X//" >'player.c' <<'END_OF_FILE'
  34. X#include "copyright.h"
  35. X
  36. X#include "db.h"
  37. X#include "config.h"
  38. X#include "interface.h"
  39. X#include "externs.h"
  40. X
  41. X#ifndef PLAYER_LIST    
  42. X/* don't use this, it's expensive */
  43. X/* maybe soon we'll put in a hash table */
  44. Xdbref lookup_player(const char *name)
  45. X{
  46. X    dbref i;
  47. X
  48. X    for(i = 0; i < db_top; i++) {
  49. X    if(Typeof(i) == TYPE_PLAYER
  50. X       && db[i].name && !string_compare(db[i].name, name)) return i;
  51. X    }
  52. X    return NOTHING;
  53. X}
  54. X#endif PLAYER_LIST
  55. X
  56. Xdbref connect_player(const char *name, const char *password)
  57. X{
  58. X    dbref player;
  59. X
  60. X    if((player = lookup_player(name)) == NOTHING) return NOTHING;
  61. X    if(db[player].password
  62. X       && *db[player].password
  63. X       &&strcmp(db[player].password, password)) return NOTHING;
  64. X
  65. X    return player;
  66. X}
  67. X
  68. Xdbref create_player(const char *name, const char *password)
  69. X{
  70. X    dbref player;
  71. X
  72. X    if(!ok_player_name(name) || !ok_password(password)) return NOTHING;
  73. X
  74. X    /* else he doesn't already exist, create him */
  75. X    player = new_object();
  76. X
  77. X    /* initialize everything */
  78. X    db[player].name = alloc_string(name);
  79. X    db[player].location = PLAYER_START;
  80. X    db[player].exits = PLAYER_START;    /* home */
  81. X    db[player].owner = player;
  82. X    db[player].flags = TYPE_PLAYER;
  83. X    db[player].password = alloc_string(password);
  84. X    
  85. X    /* link him to PLAYER_START */
  86. X    PUSH(player, db[PLAYER_START].contents);
  87. X
  88. X#ifdef PLAYER_LIST
  89. X    add_player(player);
  90. X#endif PLAYER_LIST    
  91. X
  92. X    return player;
  93. X}
  94. X
  95. Xvoid do_password(dbref player, const char *old, const char *newobj)
  96. X{
  97. X    if(!db[player].password || strcmp(old, db[player].password)) {
  98. X    notify(player, "Sorry");
  99. X    } else if(!ok_password(newobj)) {
  100. X    notify(player, "Bad new password.");
  101. X    } else {
  102. X    free((void *) db[player].password);
  103. X    db[player].password = alloc_string(newobj);
  104. X    notify(player, "Password changed.");
  105. X    }
  106. X}
  107. END_OF_FILE
  108. if test 1801 -ne `wc -c <'player.c'`; then
  109.     echo shar: \"'player.c'\" unpacked with wrong size!
  110. fi
  111. # end of 'player.c'
  112. fi
  113. if test -f 'set.c' -a "${1}" != "-c" ; then 
  114.   echo shar: Will not clobber existing file \"'set.c'\"
  115. else
  116. echo shar: Extracting \"'set.c'\" \(16561 characters\)
  117. sed "s/^X//" >'set.c' <<'END_OF_FILE'
  118. X#include "copyright.h"
  119. X
  120. X/* commands which set parameters */
  121. X#include <stdio.h>
  122. X#include <ctype.h>
  123. X
  124. X#include "db.h"
  125. X#include "config.h"
  126. X#include "match.h"
  127. X#include "interface.h"
  128. X#include "externs.h"
  129. X
  130. X#ifdef COMPRESS
  131. X#define alloc_compressed(x) alloc_string(compress(x))
  132. X#else /* COMPRESS */
  133. X#define alloc_compressed(x) alloc_string(x)
  134. X#endif /* COMPRESS */
  135. X
  136. X#define FREE_STRING(X) X = ((X) ? (free ((void *) (X)), NULL) : NULL)
  137. X
  138. Xstatic dbref match_controlled(dbref player, const char *name)
  139. X{
  140. X    dbref match;
  141. X
  142. X    init_match(player, name, NOTYPE);
  143. X    match_everything();
  144. X
  145. X    match = noisy_match_result();
  146. X    if(match != NOTHING && !controls(player, match)) {
  147. X    notify(player, "Permission denied.");
  148. X    return NOTHING;
  149. X    } else {
  150. X    return match;
  151. X    }
  152. X}
  153. X
  154. Xvoid do_name(dbref player, const char *name, char *newname)
  155. X{
  156. X    dbref thing;
  157. X    char *password;
  158. X
  159. X    if((thing = match_controlled(player, name)) != NOTHING) {
  160. X    /* check for bad name */
  161. X    if(*newname == '\0') {
  162. X        notify(player, "Give it what new name?");
  163. X        return;
  164. X    }
  165. X
  166. X    /* check for renaming a player */
  167. X    if(Typeof(thing) == TYPE_PLAYER) {
  168. X        /* split off password */
  169. X        for(password = newname;
  170. X        *password && !isspace(*password);
  171. X        password++);
  172. X        /* eat whitespace */
  173. X        if(*password) {
  174. X        *password++ = '\0'; /* terminate name */
  175. X        while(*password && isspace(*password)) password++;
  176. X        }
  177. X
  178. X        /* check for null password */
  179. X        if(!*password) {
  180. X        notify(player,
  181. X               "You must specify a password to change a player name.");
  182. X        notify(player, "E.g.: name player = newname password");
  183. X        return;
  184. X        } else if(strcmp (db[thing].name, "guest") == 0) {
  185. X        notify(player,
  186. X               "You are only a guest here...no name changing.");
  187. X        return;
  188. X        } else if(!db[thing].password) {
  189. X        /* If original has no password, set one */
  190. X        db[thing].password = alloc_string(password);
  191. X        } else if(strcmp(password, db[thing].password)) {
  192. X        notify(player, "Incorrect password.");
  193. X        return;
  194. X        } else if(string_compare(newname, db[thing].name) &&
  195. X              !ok_player_name(newname)) {
  196. X        notify(player, "You can't give a player that name.");
  197. X        return;
  198. X        }
  199. X        /* everything ok, notify */
  200. X        writelog("NAME CHANGE: %s(#%d) to %s\n",
  201. X            db[thing].name, thing, newname);
  202. X#ifdef PLAYER_LIST
  203. X        delete_player(thing);
  204. X        free((void *) db[thing].name);
  205. X        db[thing].name = alloc_string(newname);
  206. X        add_player(thing);
  207. X        notify(player, "Name set.");
  208. X        return;
  209. X#endif PLAYER_LIST        
  210. X    } else {
  211. X        if(!ok_name(newname)) {
  212. X        notify(player, "That is not a reasonable name.");
  213. X        return;
  214. X        }
  215. X    }
  216. X
  217. X    /* everything ok, change the name */
  218. X    if(db[thing].name) {
  219. X        free((void *) db[thing].name);
  220. X    }
  221. X    db[thing].name = alloc_string(newname);
  222. X    notify(player, "Name set.");
  223. X    }
  224. X}
  225. X
  226. Xvoid do_describe(dbref player, const char *name, const char *description)
  227. X{
  228. X    dbref thing;
  229. X
  230. X    if((thing = match_controlled(player, name)) != NOTHING) {
  231. X    if(db[thing].description) {
  232. X        free((void *) db[thing].description);
  233. X    }
  234. X    db[thing].description = alloc_compressed(description);
  235. X    notify(player, "Description set.");
  236. X    }
  237. X}
  238. X
  239. Xvoid do_fail(dbref player, const char *name, const char *message)
  240. X{
  241. X    dbref thing;
  242. X
  243. X    if((thing = match_controlled(player, name)) != NOTHING) {
  244. X    if(db[thing].fail_message) {
  245. X        free((void *) db[thing].fail_message);
  246. X    }
  247. X    db[thing].fail_message = alloc_compressed(message);
  248. X    notify(player, "Message set.");
  249. X    }
  250. X}
  251. X
  252. Xvoid do_success(dbref player, const char *name, const char *message)
  253. X{
  254. X    dbref thing;
  255. X
  256. X    if((thing = match_controlled(player, name)) != NOTHING) {
  257. X    if(db[thing].succ_message) {
  258. X        free((void *) db[thing].succ_message);
  259. X    }
  260. X    db[thing].succ_message = alloc_compressed(message);
  261. X    notify(player, "Message set.");
  262. X    }
  263. X}
  264. X
  265. Xvoid do_osuccess(dbref player, const char *name, const char *message)
  266. X{
  267. X    dbref thing;
  268. X
  269. X    if((thing = match_controlled(player, name)) != NOTHING) {
  270. X    if(db[thing].osuccess) {
  271. X        free((void *) db[thing].osuccess);
  272. X    }
  273. X    db[thing].osuccess = alloc_compressed(message);
  274. X    notify(player, "Message set.");
  275. X    }
  276. X}
  277. X
  278. Xvoid do_ofail(dbref player, const char *name, const char *message)
  279. X{
  280. X    dbref thing;
  281. X
  282. X    if((thing = match_controlled(player, name)) != NOTHING) {
  283. X    if(db[thing].ofail) {
  284. X        free((void *) db[thing].ofail);
  285. X    }
  286. X    db[thing].ofail = alloc_compressed(message);
  287. X    notify(player, "Message set.");
  288. X    }
  289. X}
  290. X
  291. Xvoid do_lock(dbref player, const char *name, const char *keyname)
  292. X{
  293. X    dbref thing;
  294. X    struct boolexp *key;
  295. X
  296. X    init_match(player, name, NOTYPE);
  297. X    match_everything();
  298. X
  299. X    switch(thing = match_result()) {
  300. X      case NOTHING:
  301. X    notify(player, "I don't see what you want to lock!");
  302. X    return;
  303. X      case AMBIGUOUS:
  304. X    notify(player, "I don't know which one you want to lock!");
  305. X    return;
  306. X      default:
  307. X    if(!controls(player, thing)) {
  308. X        notify(player, "You can't lock that!");
  309. X        return;
  310. X    }
  311. X    break;
  312. X    }
  313. X
  314. X    key = parse_boolexp(player, keyname);
  315. X    if(key == TRUE_BOOLEXP) {
  316. X    notify(player, "I don't understand that key.");
  317. X    } else {
  318. X    /* everything ok, do it */
  319. X    free_boolexp(db[thing].key);
  320. X    db[thing].key = key;
  321. X    notify(player, "Locked.");
  322. X    }
  323. X}
  324. X
  325. Xvoid do_unlock(dbref player, const char *name)
  326. X{
  327. X    dbref thing;
  328. X
  329. X    if((thing = match_controlled(player, name)) != NOTHING) {
  330. X    free_boolexp(db[thing].key);
  331. X    db[thing].key = TRUE_BOOLEXP;
  332. X    notify(player, "Unlocked.");
  333. X    }
  334. X}
  335. X
  336. Xvoid do_unlink(dbref player, const char *name)
  337. X{
  338. X    dbref exit;
  339. X
  340. X    init_match(player, name, TYPE_EXIT);
  341. X    match_exit();
  342. X    match_here();
  343. X    if(Wizard(player)) {
  344. X    match_absolute();
  345. X    }
  346. X
  347. X    switch(exit = match_result()) {
  348. X      case NOTHING:
  349. X    notify(player, "Unlink what?");
  350. X    break;
  351. X      case AMBIGUOUS:
  352. X    notify(player, "I don't know which one you mean!");
  353. X    break;
  354. X      default:
  355. X    if(!controls(player, exit)) {
  356. X        notify(player, "Permission denied.");
  357. X    } else {
  358. X        switch(Typeof(exit)) {
  359. X          case TYPE_EXIT:
  360. X        db[exit].location = NOTHING;
  361. X        notify(player, "Unlinked.");
  362. X        break;
  363. X          case TYPE_ROOM:
  364. X        db[exit].location = NOTHING;
  365. X        notify(player, "Dropto removed.");
  366. X        break;
  367. X          default:
  368. X        notify(player, "You can't unlink that!");
  369. X        break;
  370. X        }
  371. X    }
  372. X    }
  373. X}
  374. X
  375. Xvoid do_chown(dbref player, const char *name, const char *newobj)
  376. X{
  377. X    dbref thing;
  378. X    dbref owner;
  379. X    
  380. X    init_match(player, name, NOTYPE);
  381. X    match_everything();
  382. X
  383. X    if((thing = noisy_match_result()) == NOTHING) {
  384. X    return;
  385. X    } else if((owner = lookup_player(newobj)) == NOTHING &&
  386. X          string_compare(newobj,"me")) {
  387. X    notify(player, "I couldn't find that player.");
  388. X    } else if(Typeof(thing) == TYPE_PLAYER) {
  389. X    notify(player, "Players always own themselves.");
  390. X    } else if (!Wizard(player) &&
  391. X           ((string_compare(newobj,"me") &&
  392. X         owner != player) || !(db[thing].flags & UNWANTED))) {
  393. X    notify(player, "Permission denied.");
  394. X    } else if (!Wizard(player) && !could_doit(player,thing)) {
  395. X    notify(player, "That item is locked.");
  396. X    } else {
  397. X    if (!string_compare(newobj,"me"))
  398. X        owner = player;
  399. X    db[thing].owner = owner;
  400. X    notify(player, "Owner changed.");
  401. X    }
  402. X}
  403. X
  404. Xvoid do_set(dbref player, const char *name, const char *flag)
  405. X{
  406. X    dbref thing;
  407. X    const char *p;
  408. X    object_flag_type f;
  409. X
  410. X    /* find thing */
  411. X    if((thing = match_controlled(player, name)) == NOTHING) return;
  412. X
  413. X    /* move p past NOT_TOKEN if present */
  414. X    for(p = flag; *p && (*p == NOT_TOKEN || isspace(*p)); p++);
  415. X
  416. X    /* identify flag */
  417. X    if(*p == '\0') {
  418. X    notify(player, "You must specify a flag to set.");
  419. X    return;
  420. X    } else if(string_prefix("LINK_OK", p)) {
  421. X    f = LINK_OK;
  422. X    } else if(string_prefix("DARK", p)) {
  423. X    f = DARK;
  424. X    } else if(string_prefix("STICKY", p)) {
  425. X    f = STICKY;
  426. X    } else if(string_prefix("WIZARD", p) ||
  427. X              string_prefix("TINKER", p)) {
  428. X    f = WIZARD;
  429. X    } else if(string_prefix("TEMPLE", p) ||
  430. X              string_prefix("JUNKPILE", p)) {
  431. X    f = TEMPLE;
  432. X    } else if(string_prefix("HAVEN", p)) {
  433. X    f = HAVEN;
  434. X    } else if(string_prefix("ABODE", p)) {
  435. X    f = ABODE;
  436. X    } else if(string_prefix("UNWANTED", p)) {
  437. X    f = UNWANTED;
  438. X#ifdef ROBOT_MODE
  439. X    } else if(string_prefix("ROBOT", p) ||
  440. X          string_prefix("BOT", p)) {
  441. X    if (Typeof(thing) == TYPE_PLAYER) {
  442. X        if (Wizard(player)) {
  443. X        writelog ("ROBOT: success %s(%d) %s %s(%d)\n",
  444. X              db[player].name, player,
  445. X              *flag == NOT_TOKEN ? "reset" : "set",
  446. X              db[thing].name, thing);
  447. X        } else {
  448. X        writelog ("ROBOT: failed %s(%d) %s %s(%d)\n",
  449. X              db[player].name, player,
  450. X              *flag == NOT_TOKEN ? "reset" : "set",
  451. X              db[thing].name, thing);
  452. X        notify(player,
  453. X#ifndef TINKER
  454. X               "Only a Wizard can designate a player robotic.");
  455. X#else TINKER
  456. X               "Only a Tinker can designate a player robotic.");
  457. X#endif TINKER
  458. X        return;
  459. X        }
  460. X    }
  461. X    f = ROBOT;
  462. X#endif ROBOT_MODE
  463. X    } else if(string_prefix("TABULAR_WHO", p)) {
  464. X    f = TABULAR_WHO;
  465. X    } else if(string_prefix("REVERSED_WHO", p)) {
  466. X    f = REVERSED_WHO;
  467. X#ifdef GENDER
  468. X    } else if(string_prefix("MALE", p) || string_prefix("FEMALE", p) ||
  469. X              string_prefix("NEUTER", p)   || string_prefix("UNASSIGNED", p)) {
  470. X        if (Typeof(thing) != TYPE_PLAYER) {
  471. X        notify(player, "Sorry, only players have gender.");
  472. X        return;
  473. X        }
  474. X        if (thing != player && !Wizard(player)) {
  475. X        notify(player, "You can only give yourself a sex-change.");
  476. X        return;
  477. X        }
  478. X        db[thing].flags &= ~GENDER_MASK;
  479. X    if(string_prefix("UNASSIGNED", p) || *flag == NOT_TOKEN) {
  480. X        db[thing].flags |= (GENDER_UNASSIGNED << GENDER_SHIFT);
  481. X        notify(player, "Gender set to unassigned.");
  482. X    } else if (string_prefix("MALE", p)) {
  483. X        db[thing].flags |= (GENDER_MALE << GENDER_SHIFT);
  484. X        notify(player, "Gender set to male.");
  485. X        } else if(string_prefix("FEMALE", p)) {
  486. X        db[thing].flags |= (GENDER_FEMALE << GENDER_SHIFT);
  487. X        notify(player, "Gender set to female.");
  488. X        } else if(string_prefix("NEUTER", p)) {
  489. X        db[thing].flags |= (GENDER_NEUTER << GENDER_SHIFT);
  490. X        notify(player, "Gender set to neuter.");
  491. X    }
  492. X        return;
  493. X#endif /* GENDER */
  494. X#ifdef RESTRICTED_BUILDING
  495. X    } else if(string_prefix("BUILDER", p) ||) {
  496. X              string_prefix("CONSTRUCTOR", p)
  497. X    f = BUILDER;
  498. X#endif                /* RESTRICTED_BUILDING */
  499. X    } else {
  500. X    notify(player, "I don't recognize that flag.");
  501. X    return;
  502. X    }
  503. X
  504. X    /* check for restricted flag */
  505. X    if(!Wizard(player)
  506. X       && (f == TEMPLE
  507. X#ifdef RESTRICTED_BUILDING
  508. X       || f == BUILDER
  509. X#endif /* RESTRICTED_BUILDING */
  510. X       || f == DARK &&
  511. X       (Typeof(thing) != TYPE_ROOM && Typeof(thing) != TYPE_THING))) {
  512. X    notify(player, "Permission denied.");
  513. X    return;
  514. X    }
  515. X
  516. X#ifdef GOD_PRIV
  517. X    if (!God(player) && f == DARK && Typeof(thing) == TYPE_PLAYER) {
  518. X    notify(player, "Permission denied.");
  519. X    return;
  520. X    }
  521. X#endif GOD_PRIV
  522. X
  523. X    if (!Wizard(player) && f == DARK && Typeof(thing) == TYPE_THING &&
  524. X        db[thing].location != player) {
  525. X    notify(player, "You must be holding an object to set it DARK.");
  526. X    return;
  527. X    }
  528. X
  529. X#ifdef GOD_PRIV
  530. X    if(!God(player) && (f == WIZARD)) {
  531. X#else
  532. X    if (!Wizard(player) && (f == WIZARD)) {
  533. X#endif GOD_PRIV
  534. X    writelog ("WIZARD: failed %s(%d) %s %s(%d)\n",
  535. X          db[player].name, player,
  536. X          *flag == NOT_TOKEN ? "reset" : "set",
  537. X          db[thing].name, thing);
  538. X
  539. X    notify(player, "Permission denied.");
  540. X    return;
  541. X    }
  542. X
  543. X    if (f == WIZARD) {
  544. X    writelog ("WIZARD: success %s(%d) %s %s(%d)\n",
  545. X          db[player].name, player,
  546. X          *flag == NOT_TOKEN ? "reset" : "set",
  547. X          db[thing].name, thing);
  548. X    }
  549. X
  550. X#ifdef GOD_PRIV
  551. X    /* check for unGODding */
  552. X    if (f == WIZARD && God(thing)) {
  553. X    notify(player, "Gods can not me made mortal.");
  554. X    return;
  555. X    }
  556. X#else
  557. X    if (f == WIZARD && thing == player) {
  558. X    notify(player, "You cannot make yourself mortal!");
  559. X    return;
  560. X    }
  561. X#endif GOD_PRIV
  562. X
  563. X    if ( f==HAVEN && !(Typeof(thing) == TYPE_ROOM ||
  564. X               Typeof(thing) == TYPE_PLAYER)) {
  565. X    notify(player, "Only rooms or players can be HAVEN.");
  566. X    return;
  567. X    }
  568. X
  569. X    if (f==UNWANTED && Typeof(thing)==TYPE_PLAYER) {
  570. X    notify(player, "You should always want yourself.");
  571. X    return;
  572. X    }
  573. X
  574. X    if ((f==TABULAR_WHO || f==REVERSED_WHO) &&
  575. X    Typeof(thing) != TYPE_PLAYER) {
  576. X    notify(player, "Player preference flags can only be set on players.");
  577. X    return;
  578. X    }
  579. X    
  580. X    /* else everything is ok, do the set */
  581. X    if(*flag == NOT_TOKEN) {
  582. X    /* reset the flag */
  583. X    db[thing].flags &= ~f;
  584. X    notify(player, "Flag reset.");
  585. X    } else {
  586. X    /* set the flag */
  587. X    db[thing].flags |= f;
  588. X    notify(player, "Flag set.");
  589. X    }
  590. X}
  591. X
  592. X#ifdef RECYCLE
  593. X/****************************************************************
  594. X * do_recycle: Allow any player to give an item away...the item
  595. X * is @chowned to the "Recycler" player, and if it's a thing,
  596. X * it is @linked to the home of the "Recycler" as well.
  597. X ****************************************************************/
  598. X
  599. Xvoid do_recycle(dbref player, const char *name)
  600. X{
  601. X    dbref thing, recip, i;
  602. X    char buf[BUFFER_LEN];
  603. X
  604. X    if (!name || !*name) {
  605. X    notify(player, "You must specify an object to @recycle.");
  606. X    return;
  607. X    }
  608. X
  609. X    if((thing = match_controlled(player, name)) == NOTHING) return;
  610. X    
  611. X    if(Typeof(thing) == TYPE_PLAYER) {
  612. X    notify(player, "You can't @recycle players.");
  613. X    return;
  614. X    }
  615. X
  616. X    if((recip = lookup_player(RECYCLER)) == NOTHING) {
  617. X    notify(player, "There is no current Recycler.");
  618. X    return;
  619. X    }
  620. X    
  621. X    /* Okay - do it */
  622. X    db[thing].owner = recip;
  623. X
  624. X    /* If its a thing, link it to the Recyclers home */
  625. X    if (Typeof(thing) == TYPE_THING) {
  626. X    db[thing].exits = db[recip].exits;
  627. X    moveto (thing, db[thing].exits);
  628. X    }
  629. X
  630. X    /* Clear its strings */
  631. X    FREE_STRING (db[thing].name);
  632. X    FREE_STRING (db[thing].description);
  633. X    FREE_STRING (db[thing].fail_message);
  634. X    FREE_STRING (db[thing].ofail);
  635. X    FREE_STRING (db[thing].succ_message);
  636. X    FREE_STRING (db[thing].osuccess);
  637. X    sprintf (buf, "junk-%d", thing);
  638. X    db[thing].name = alloc_string(buf);
  639. X
  640. X    /* unlock it */
  641. X    free_boolexp(db[thing].key);
  642. X    db[thing].key = TRUE_BOOLEXP;
  643. X
  644. X    /* Make it worthless */
  645. X    db[thing].pennies = 1;
  646. X
  647. X    /* Make it up for grabs */
  648. X    db[thing].flags |= UNWANTED;
  649. X
  650. X    /* Tell player we did it */    
  651. X    notify(player, "Object recycled.");
  652. X}
  653. X
  654. X/****************************************************************
  655. X * do_count: count things...
  656. X *    players:    Number of objects owned, carried
  657. X *    rooms:        number of exits from & to, number contents
  658. X ****************************************************************/
  659. X
  660. Xvoid do_count(dbref player, const char *name)
  661. X{
  662. X    dbref thing, i, exit;
  663. X    char buf[BUFFER_LEN];
  664. X    int owned=0, contents=0, from=0, to=0, objects=0, rooms=0, exits=0;
  665. X    int rowned=0, rplayers=0, robjects=0, rrooms=0, rexits=0;
  666. X
  667. X    if (!name || !*name) {
  668. X    notify(player, "You must specify an object to @count.");
  669. X    return;
  670. X    }
  671. X
  672. X    if((thing = match_controlled(player, name)) == NOTHING) return;
  673. X
  674. X    if(Typeof(thing) != TYPE_PLAYER && Typeof(thing) != TYPE_ROOM) {
  675. X    notify(player, "You can only @count people or rooms.\n");
  676. X    return;
  677. X    }
  678. X
  679. X    if(!payfor(player, FIND_COST)) {
  680. X    notify(player, "You don't have enough pennies.");
  681. X    return;
  682. X    }
  683. X    
  684. X    switch (Typeof(thing)) {
  685. X      case TYPE_PLAYER:
  686. X    for (i=0; i<db_top; i++) {
  687. X        if (db[i].location == thing) contents++;
  688. X        if (db[i].owner == thing) {
  689. X        switch (Typeof(i)) {
  690. X          case TYPE_THING:    objects++; break;
  691. X          case TYPE_EXIT:    exits++; break;
  692. X          case TYPE_ROOM:    rooms++; break;
  693. X        }
  694. X        owned++;
  695. X        }
  696. X    }
  697. X    sprintf(buf,
  698. X         "%s owns %d objects (%d things, %d rooms, %d exits), %d carried.",
  699. X        unparse_object(player, thing),
  700. X            owned, objects, rooms, exits, contents);
  701. X    notify(player, buf);
  702. X    break;
  703. X
  704. X      case TYPE_ROOM:
  705. X    for (i=0; i<db_top; i++) {
  706. X        if (db[i].location == thing) {
  707. X        if (Typeof(i) == TYPE_EXIT) {
  708. X            to++;
  709. X        } else {
  710. X            contents++;
  711. X        }
  712. X        }
  713. X    }
  714. X    DOLIST(exit, db[thing].exits) {
  715. X        from++;
  716. X    }
  717. X    sprintf(buf, "%s has %d entrances, %d exits, %d objects.",
  718. X        unparse_object(player, thing), to, from, contents);
  719. X    notify(player, buf);
  720. X    
  721. X    if (!Wizard (player)) break;
  722. X
  723. X    for (i=0; i<db_top; i++) {
  724. X        if (db[db[i].owner].location == thing) {
  725. X            switch (Typeof(i)) {
  726. X          case TYPE_EXIT: rexits++; break;
  727. X            case TYPE_ROOM: rrooms++; break;
  728. X            case TYPE_THING: robjects++; break;
  729. X          case TYPE_PLAYER: rplayers++; break;
  730. X        }
  731. X        rowned++;
  732. X        }
  733. X    }
  734. X
  735. X    if (rplayers == 0) {
  736. X        sprintf (buf, "There are no players in %s.\n",
  737. X        unparse_object (player, thing));
  738. X    } else {
  739. X        sprintf(buf,
  740. X            "The %d player%s in %s own%s %d %s: %d %s, %d %s, %d %s\n.",
  741. X        rplayers, (rplayers == 1) ? "" : "s",
  742. X        unparse_object(player, thing), (rplayers == 1) ? "s" : "",
  743. X        rowned, "objects", robjects, "things", rrooms, "rooms",
  744. X        rexits, "exits");
  745. X    }
  746. X
  747. X    notify(player, buf);
  748. X
  749. X    break;
  750. X    }
  751. X
  752. X}
  753. X#endif RECYCLE
  754. X
  755. END_OF_FILE
  756. if test 16561 -ne `wc -c <'set.c'`; then
  757.     echo shar: \"'set.c'\" unpacked with wrong size!
  758. fi
  759. # end of 'set.c'
  760. fi
  761. if test -f 'tiny.docs' -a "${1}" != "-c" ; then 
  762.   echo shar: Will not clobber existing file \"'tiny.docs'\"
  763. else
  764. echo shar: Extracting \"'tiny.docs'\" \(33769 characters\)
  765. sed "s/^X//" >'tiny.docs' <<'END_OF_FILE'
  766. XThis set of docs is tailored for Chaos, which is running TinyMUCK2.1.1.
  767. XGenerally, though, these commands hold true for any mud.     
  768. X    
  769. XCOMMANDS: drop, examine, get, give, go, gripe, help, inventory, kill, look, 
  770. Xnews, OUPUTPREFIX, OUTPUTSUFFIX, page, QUIT, rob, say, score, whisper, WHO,
  771. X@action, @attach, @boot, @chown, @create, @describe, @dump, @dig, @drop, @dump,
  772. X@fail, @find, @force, @link, @lock, @name, @newpassword, @odrop, @ofail, @open,
  773. X@osuccess, @password, @pcreate, @prog, @recycle, @set, @shutdown, @stats, 
  774. X@success, @teleport, @toad, @unlink, @unlock, @wall
  775. X
  776. XTOPICS: being killed, custom commands, control, costs, dropping, drop-tos,
  777. Xfailure, flags (wizard, sticky, link_ok, dark, temple, haven, chown_ok,
  778. Xabode, jump_ok, mucker, builder), gender, goal, here, homes, me, money,
  779. Xrobbery, sacrificing, strings, substitutions, success, types, actions,
  780. Xlinking, meta-links, properties, muf.
  781. X
  782. Xdrop <object>.    Drops the <object> if you are holding it. It moves the object
  783. X        to the room you are in, unless its STICKY flag is set (See
  784. X        STICKY), or the room has a drop-to (See DROP-TOS). 
  785. X        Dropping a thing in a room with the TEMPLE flag set
  786. X        sacrifices it (See SACRIFICING).  Unlinked exits can only
  787. X        be dropped in rooms you control (See CONTROL).
  788. X        'throw' is the same as 'drop'.
  789. X
  790. Xexamine [object]. Displays all available information about <object>. <object>
  791. X        can be specified as <name> or #<number>, or as 'me' or 'here'.
  792. X        You must control (See CONTROL) the object to examine it. If
  793. X        you do not control the object, you will just be shown the
  794. X        owner of the object and its description.
  795. X        Wizards can examine objects in other rooms using #<number>
  796. X        or *<player>.
  797. X
  798. Xget <object>.    Picks up <object> if it is in the same room as you, and if
  799. X        it is not locked (See @lock). <object> can be a thing or an
  800. X        unlinked exit.
  801. X        'take' is the same as 'get'.
  802. X
  803. Xgive <player>=<pennies>. Gives <player> the specified number of pennies. The
  804. X        only thing you can give is pennies. You can't give someone
  805. X        pennies if their new total would be greater than 10000.
  806. X        Wizards can give as many pennies as they wish, even negative
  807. X        amounts, without affecting their own supply, and can give
  808. X        pennies to things to change their sacrifice values.
  809. X
  810. Xgo[to] <direction>; go[to] home.
  811. X        Goes in the specified direction. 'go home' is a special
  812. X        command that returns you to your home (See HOMES). The word
  813. X        'go' may be omitted. (You can 'go east', or simply 'east').
  814. X        'move' is the same as 'go'.
  815. X
  816. Xgripe <message>. Sends <message> to the system maintainer.
  817. X
  818. Xhelp.        This displays a short help message.
  819. X
  820. Xinventory.    Lists what you are carrying. This can usually be abbreviated
  821. X        to inv.
  822. X
  823. Xkill <player> [=<cost>]. Attempts to kill <player>. Killing costs either
  824. X        <cost> or 10 pennies, whichever is greater. The probability
  825. X        of success is <cost> percent. Spending 100 pennies always
  826. X        works (except against Wizards, who can never be killed).
  827. X        Killing a player sends them to their home (See HOMES), just
  828. X        as the command 'go home' would (See go). It also gives the
  829. X        killed player 50 pennies.
  830. X        Players cannot be killed in rooms which have the HAVEN flag
  831. X        set (see HAVEN).
  832. X
  833. Xlook [object].    Displays the description of <object>, or the room you're in 
  834. X        if you don't specify one. <object> can be a thing, player,
  835. X        exit, or room, specified as <name> or #<number> or 'me' or
  836. X        'here'. Wizards can look at objects in other rooms using
  837. X        #<number> or *<player>.
  838. X        'read' is the same as 'look'.
  839. X
  840. Xnews.        Displays the current news file for the game. Must be typed
  841. X        in full.
  842. X
  843. XOUTPUTPREFIX [string]. Must be in all capitals, and must be typed in full.
  844. X        This prints the given string before the output of every
  845. X        command. 
  846. X
  847. XOUTPUTSUFFIX [string]. Must be in all capitals, and must be typed in full.
  848. X        This prints the given string after the output of every
  849. X        command.
  850. X
  851. Xpage <player> [=<message>]. This tells a player that you are looking for them.
  852. X        They will get a message telling them your name and location.
  853. X        This costs 1 penny. If you include the '=<message>', it will
  854. X        tell the player your name and your message, along with your
  855. X        location. This will not work if the player you're trying to
  856. X        page is not connected.  If a player has the HAVEN flag set
  857. X        (See HAVEN), you cannot page them, and they will not be
  858. X        notified that you tried.
  859. X
  860. Xpose <action>.  The normal abbreviation for this is ':<message>'. This is used
  861. X        for actions, ex. if your name was Igor, and you typed ':falls
  862. X        down.', everyone would see "Igor falls down." (See also
  863. X        whisper).
  864. X
  865. XQUIT.        This command logs you out of the game. Must be in all capitals.
  866. X
  867. Xrob <player>.    Attempts to steal one penny from <player>. The only thing
  868. X        you can rob are pennies. Being robbed can be prevented (See
  869. X        ROBBING).
  870. X
  871. Xsay <message>.    Says <message> out loud. You can also use '"<message>'.
  872. X
  873. Xscore.        Displays how many pennies you are carrying.
  874. X
  875. Xwhisper <player>=<message>. Whispers <message> to <player>, if they are in
  876. X        the same room as you. No one else can see the message.
  877. X        Wizards can whisper *<player>=<message> to whisper to
  878. X        players in other rooms. This command will not work if
  879. X        the player you are trying to whisper to is not connected.
  880. X
  881. XWHO [<player>].    List the name of every player currently logged in, and how
  882. X        long they have been inactive. If given a player name, it
  883. X        displays only that name and idle time. Must be in all
  884. X        capitals.
  885. X
  886. X@action <name>[=<object>]. This sets up an action and attaches it to the
  887. X        thing, room, or player specified. '@action' alone
  888. X        will create an action and you can then use '@attach' to
  889. X        attach it to something (See @attach, ACTIONS). 
  890. X
  891. X@attach <name>=<object>. Attaches the named action to <object>. 
  892. X
  893. X@boot <player>.    Disconnects the player from the game. Only Wizards can use
  894. X        this command.
  895. X
  896. X@chown <object>[=<player>]. Changes the ownership of <object> to <player>.
  897. X        Normally, only wizards may use this command. However,
  898. X        if the object is set CHOWN_OK (see CHOWN_OK), players 
  899. X        can chown it to themselves with 'chown <object>' if they
  900. X        pick the object up. Players can't be @chowned; they always 
  901. X        own themselves.
  902. X
  903. X@create <name> [=<cost>]. Creates a thing with the specified name. Creation
  904. X        costs either <cost> pennies or 10 pennies, whichever is
  905. X        greater. The value of a thing is proportional to its cost.
  906. X        To be exact, value=(cost/5)-1.
  907. X
  908. X@describe <object> [=<description>]. <object> can be a thing, player, exit, or
  909. X        room, specified as <name> or #<number> or 'me' or 'here'.
  910. X        This sets the description a player sees when they use the
  911. X        command 'look <object>'. Without a description argument, it
  912. X        clears the message. 
  913. X        It can be abbreviated @desc.
  914. X
  915. X@dig <name>.    Creates a new room with the specified name and displays its
  916. X        number. This costs 10 pennies.
  917. X
  918. X@drop <object>[=<message>]. Sets the drop message on <object>.  <object>
  919. X        can be specified as <name> or #<number> or 'me' or 'here'.
  920. X        The drop message on a thing is displayed when the
  921. X        thing is dropped. The drop message on an exit is displayed
  922. X        when the player first enters the destination room. The drop
  923. X        message on a player tells whoever killed them how they died.
  924. X        Without a message argument, it clears the message. (See
  925. X        @odrop).
  926. X
  927. X@dump.        Only Wizards may use this command. Saves the database from
  928. X        memory to disk. Automatically occurs every hour, and when
  929. X        @shutdown is used.
  930. X
  931. X@fail <object> [=<message>]. <object> can be a thing, player, exit, or room,
  932. X        specified as <name> or #<number> or 'me' or 'here'. Sets the
  933. X        fail message for <object>. The message is displayed when a
  934. X        player fails to use <object> (See FAILURE). Without a
  935. X        message argument, it clears the message. (See @ofail).
  936. X
  937. X@find [name].    Displays the name and number of every room, thing, or player
  938. X        that you control whose name matches <name>. Because the
  939. X        command is computationally expensive, this costs 1 penny
  940. X        or more, depending on the MUD.
  941. X
  942. X@force <player>=<command>. Only Wizards may use this command. Forces <player>
  943. X        to do <command>.
  944. X
  945. X@link <object>=<number>; @link <object>=here; @link <dir>|<room>=home. Links
  946. X        <object> to room specified by <number>. For things and 
  947. X        players, it sets their home room (See HOMES). For rooms, it
  948. X        sets the drop-to room (See DROP-TOS). To link to a room,
  949. X        you must control it, or it must be set LINK_OK (for exits),
  950. X        or ABODE (for things, players, and rooms). (See LINK_OK and
  951. X        ABODE). Linking costs 1 penny. If someone else owned the
  952. X        exit, their penny is reimbursed. You can link exits to any
  953. X        object, if you own it or it is set LINK_OK. (See LINKING,
  954. X        HOMES, DROP-TOS).
  955. X        Wizards can @link objects in other rooms using #<number>
  956. X        or *<player>.
  957. X
  958. X@lock <object>=<key>. Locks <object> to a specific key(s). <object> can be
  959. X        specified as <name> or #<number>, or as 'me' or 'here'.
  960. X        Boolean expressions are allowed, using '&' (and), '|' (or),
  961. X        '!' (not), and parentheses ('(' and ')') for grouping. To
  962. X        lock to a player, prefix their name with '*' (ex. '*Igor').
  963. X        You can lock to a program, in the same manner as locking to
  964. X        an object (by name or number). You can also lock to a property,
  965. X        with '@lock <exit>=<property>:<type>'. For example, to lock
  966. X        a door to anyone that is male, you '@lock <exit>=sex:male'.
  967. X        Notice that this will allow anyone carrying a male object to
  968. X        pass the exit as well.
  969. X
  970. X@name <object>=<new name> [<password>]. Changes the name of <object>. <object>
  971. X        can be a thing, player, exit, or room, specified as <name>
  972. X        or #<number> or 'me' or 'here'. For a player, it requires
  973. X        the player's password.
  974. X
  975. X@newpassword <player>=<password>. Only Wizards may use this command. Changes
  976. X        <player>'s password, informing <player> that you changed it.
  977. X        Must be typed in full.
  978. X
  979. X@odrop <object>[=<message>]. Sets the odrop message on <object>.  <object>
  980. X        can be specified as <name> or #<number> or 'me' or 'here'.
  981. X        The odrop message on a thing is displayed to everyone
  982. X        else in the room whenthe thing is dropped. The odrop message
  983. X        on an exit is displayed to everyone else in the room when the
  984. X        player first enters the destination room. The odrop message
  985. X        on a player tells everyone else how they died if they are
  986. X        killed. Without a message argument, it clears the message.
  987. X        (See @drop).
  988. X
  989. X@ofail <object>[=<message>]. Sets the ofail message on <object>. <object> 
  990. X        can be specified as <name> or #<number>, or as 'me' or 'here'.
  991. X        The ofail message, prefixed by the player's name, is shown 
  992. X        to others when the player fails to use <object>. Without a
  993. X        message argument, it clears the message.
  994. X        (See @fail, FAILURE).
  995. X
  996. X@open <dir>[;<other dir>]* [=<number>]. Creates an exit in the specified
  997. X        direction(s). If <number> is specified, it is linked to that
  998. X        room. Otherwise, it is created unlinked. You or anyone else
  999. X        may use the '@link' command to specify where the unlinked
  1000. X        exit leads. Opening an exit costs 1 penny. If you specify
  1001. X        <number>, linking costs 1 more penny.
  1002. X
  1003. X@osuccess <object>[=<message>]. Sets the osuccess message on <object>.
  1004. X        <object> can be specified as <name> or #<number>, or as
  1005. X        'me' or 'here'. The osuccess message, prefixed by the
  1006. X        player's name, is shown to others when the player
  1007. X        successfully uses <object>.  Without a message argument, it
  1008. X        clears the message. It can be abbreviated @osucc. 
  1009. X        (See @success, SUCCESS).
  1010. X
  1011. X@password <old password>=<new password>. This changes your password.
  1012. X
  1013. X@pcreate <name>. On muds with registration, this is a Wizard-only command
  1014. X        that creates a character with the given name.
  1015. X
  1016. X@prog.         See the MUF programmer's manual.
  1017. X
  1018. X@recycle <object>. This recycles the <object>. <object> can be a thing, 
  1019. X        room, or exit, but not a player. It changes the object
  1020. X        to a garbage object, and its number and space are reused
  1021. X        later.
  1022. X    
  1023. X@set <object>=<flag>; @set <object>=!<flag>. Sets (or, with '!', unsets) <flag>
  1024. X        on <object>. @set can also be used to set properties,
  1025. X        with '@set <object>=<property>:[type]' or '@set <object>=:' to
  1026. X        unset all properties. (See FLAGS, PROPERTIES). 
  1027. X
  1028. X@shutdown.    Only Wizards may use this command. Shuts down the game. Must
  1029. X        be typed in full.
  1030. X
  1031. X@stats [player]. Display the number of objects in the game. For Wizards, also
  1032. X        lists a breakdown by object types. Wizards can supply a player
  1033. X        name to count only objects owned by that player.
  1034. X
  1035. X@success <object> [=<message>]. Sets the success message for <object>.
  1036. X        <object> can be specified as <name> or #<number>, or as 'me'
  1037. X        or 'here'. The success message is displayed when a player
  1038. X        successfully uses <object>. Without a message argument,
  1039. X        it clears the message.  It can be abbreviated @succ.
  1040. X        (See @osuccess, USING OBJECTS).
  1041. X
  1042. X@teleport [<object>=] <room>. Teleports <object> to <room>. <object> must be a
  1043. X        thing. (Wizards can also teleport players.) You must be able
  1044. X        to link to the destination, and either control (See CONTROL)
  1045. X        the object or its current location. You can only teleport 
  1046. X        objects into a room, not into someone's inventory, unless you
  1047. X        are a Wizard. If the destination room has a drop-to, <object>
  1048. X        will go to the drop-to room instead.  
  1049. X
  1050. X@toad <player>. Only Wizards may use this command. Turns the player into a
  1051. X        slimy toad, destroying their character. Must be typed in full.  
  1052. X
  1053. X@unlink <dir>; @unlink here. Removes the link on the exit in the specified
  1054. X        direction, or removes the drop-to on the room. Unlinked exits
  1055. X        may be picked up and dropped elsewhere. Be careful, anyone
  1056. X        can relink an unlinked exit, becoming its new owner (but you 
  1057. X        will be reimbursed your 1 penny). (See @link).
  1058. X
  1059. X@unlock <object>. Removes the lock on <object>. (See @lock).
  1060. X
  1061. X@wall <message>. Only Wizards may use this command. Shouts something to every
  1062. X        player connected. Must be typed in full.
  1063. X
  1064. XBEING KILLED:
  1065. XGetting killed is no big deal. If you are killed, you return to your home, and
  1066. Xall things you carry return to their homes. You also collect 50 pennies in
  1067. Xinsurance money (unless you have >= 10000 pennies). See MONEY.
  1068. X
  1069. XCUSTOM COMMANDS:
  1070. XCustom commands can be made one of two ways. You can either use exits, or use
  1071. Xprograms. 
  1072. XUsing an exit: For example, to make a 'sit' command, one could "@open sit",
  1073. Xthen "@link sit=here" (because unlinked exits can be stolen),
  1074. X"@lock sit=me&!me" (impossible to be both at once, therefore always fails),
  1075. Xand "@fail sit=You sit on the chair."; "@ofail sit=sits on the chair.".
  1076. XSince nobody can go through it, it always fails. The @fail message is displayed
  1077. Xto the player, and the @ofail message (preceded by the player's name) to
  1078. Xeveryone else. 
  1079. XUsing a program: you'd create a MUF program on an appropriate object, like
  1080. Xa 'sit' program on a chair. (See MUF).
  1081. X
  1082. XCONTROL:
  1083. XThere are 3 rules to controlling objects: 1) You control anything you own. 2) A
  1084. Xwizard controls everything. 3) Anybody controls an unlinked exit, even if it is
  1085. Xlocked. Builders should beware of 3, lest their exits be linked or stolen.
  1086. X(In other words, never leave unlinked exits lying around unless you *want* 
  1087. Xsomeone to get them).
  1088. X
  1089. XCOSTS:
  1090. Xkill: 10p (or more, up to 100p).
  1091. Xpage: 1p.
  1092. X@create: 10p (or more, up to 505p), sacrifice value=(cost/5)-1.
  1093. X@dig: 10p.
  1094. X@find: 1p (or more, depending on the MUD).
  1095. X@link: 1p (if you didn't already own it, +1p to the previous owner).
  1096. X@open: 1p (2p if linked at the same time). 
  1097. X
  1098. XDROPPING:
  1099. XYou see the drop and odrop message on a thing when you drop it. You see
  1100. Xthe drop and odrop messages on an exit when you go through it. You see the
  1101. Xdrop and odrop messages on a person when you kill them. Drop and odrop
  1102. Xmessages have no meaning for rooms.
  1103. X
  1104. XDROP-TOs:
  1105. XWhen the @link command is used on a room, it sets a drop-to location. Any
  1106. Xobject dropped in the room (if it isn't STICKY) will go to that location. If
  1107. Xthe room is STICKY, the drop-to will be delayed until the last person in the
  1108. Xroom has left.
  1109. X
  1110. XFAILURE:
  1111. XYou fail to use a thing when you cannot take it (because its lock fails). You
  1112. Xfail to use an exit when you cannot go through it (because it's unlinked or
  1113. Xlocked). You fail to use a person when you fail to rob them. You fail to use a
  1114. Xroom when you fail to look around (because it's locked). 
  1115. X
  1116. XFLAGS:
  1117. XThe flags are displayed as letters following an object's ID number. Flags are
  1118. Xset with the @set command. The general flags are: W(izard), S(ticky),
  1119. XL(ink_OK), D(ark), T(emple), H(aven), C(hown_OK), A(bode), J(ump_OK), 
  1120. XM(ucker), and B(uilder).
  1121. XSee individual flag names.
  1122. X
  1123. XWIZARD:
  1124. XIf a person is WIZARD, they are unkillable, subject to fewer restrictions,
  1125. Xand able to use wizard commands. It is only meaningful for players. Only
  1126. Xwizard #1 can set and unset this flag. In general, WIZARDs can do anything
  1127. Xusing #<number> or *<player>. No Wizard can turn their own WIZARD flag off.
  1128. X
  1129. XSTICKY:
  1130. XIf a thing is STICKY, it goes home when dropped (See HOMES). If a room is
  1131. XSTICKY, its drop-to is delayed until the last person leaves (See DROP-TOS).
  1132. XIf an action/exit is STICKY, and it is attached to an object, the object
  1133. Xstays there when the action/exit is triggered. (See LINKING).
  1134. XNot meaningful for players.
  1135. X
  1136. XLINK_OK:
  1137. XIf something is LINK_OK, anyone can link actions or exits to it (but still
  1138. Xnot from it).  (See @link, LINKING).
  1139. X
  1140. XDARK:
  1141. XIf a room is DARK, then when people besides the owner 'look' there, they only
  1142. Xsee things they own. If a thing or player is DARK, then "look" does not list
  1143. Xthat object in the room's Contents:. Only wizards can set players dark. 
  1144. X
  1145. XTEMPLE:
  1146. XIf a room is TEMPLE, you can sacrifice things for pennies by dropping them
  1147. Xthere. It has no meaning for players, things, or exits. Only wizards can set
  1148. Xthis flag.
  1149. X
  1150. XCHOWN_OK:
  1151. XIf a thing is set CHOWN_OK, anyone can chown the object to themselves with 
  1152. X"@chown <thing>". They must pick up the object to do this.
  1153. X
  1154. XGENDER:
  1155. X@set me=sex:male|female|neuter. Default unassigned. If a player's gender
  1156. Xis set, %-substitutions will use the appropriate pronoun for that player. Only
  1157. Xmeaningful for players. See SUBSTITUTIONS.
  1158. X
  1159. XHAVEN:
  1160. X@set here=haven;@set me=haven. If a room is HAVEN, you cannot kill in that 
  1161. Xroom. If a player is set HAVEN, he cannot be paged.
  1162. X
  1163. XABODE:
  1164. X@set here=abode. If a room is set ABODE, players can set their homes there, 
  1165. Xand can set the homes of objects there. (LINK_OK is now used only for exits,
  1166. Xand ABODE is for players and objects.)
  1167. X
  1168. XJUMP_OK:
  1169. X@set <object>=jump_ok. If a room is set JUMP_OK, programs can move people
  1170. Xinto it. If a player is set JUMP_OK, actions/exits linked to that player
  1171. Xwill work (otherwise, they'll fail.) There are several other rules dealing
  1172. Xwith JUMP_OK, but they all refer to restrictions on MUF programs. See the
  1173. XMUF documentation for more details.
  1174. X
  1175. XBUILDER:
  1176. XIf this flag is in effect, only people who are set BUILDER can create
  1177. Xthings. Only Wizards can set this flag. (This flag is not currently in use
  1178. Xon _Chaos_).
  1179. X
  1180. XMUCKER:
  1181. XThis can only be set by Wizards. This flag allows players to enter @prog
  1182. Xmode, and program in MUF. (See MUF).
  1183. X
  1184. XGOAL:
  1185. XThere isn't one, except to have fun. If you're not having fun, quit. Have fun.
  1186. X
  1187. XHERE:
  1188. XThe word 'here' refers to the room you are in. For example, to rename the room
  1189. Xyou're in (if you control it), you could enter "@name here=<new name>".
  1190. X
  1191. XHOMES:
  1192. XEvery thing or player has a home. This is where things go when sacrificed,
  1193. Xplayers when they go home, or things with the STICKY flag set go when dropped
  1194. X(See STICKY). Homes are set with the @link command. A thing's home defaults to
  1195. Xthe room where it was created, if you control that room, or your home. You can
  1196. Xlink an exit to send players home (with their inventory) by "@link <dir>=home".
  1197. XDrop-tos can also be set to 'home' (See DROP-TOS, @link).
  1198. X
  1199. XME:
  1200. XThe word 'me' refers to yourself. Some things to do when starting out: 1) give
  1201. Xyourself a description with "@describe me=<description>", then look at yourself
  1202. Xwith "look me". 2) prevent anyone else from robbing you with "@lock me=me". 3)
  1203. Xset your gender, if you wish it known, with "@set me=sex:male" or
  1204. X"@set me=sex:female" (or "@set me=sex:neuter" to be an 'it'). 
  1205. X
  1206. XMONEY:
  1207. XBuilding and some other actions cost money. How to get money: 1) find pennies.
  1208. X2) sacrifice (drop) things in the temple. 3) get killed. 4) be given money. 5)
  1209. Xrob someone. Once you reach 10000 pennies, it becomes difficult to acquire
  1210. Xmore. (See COSTS and SACRIFICING).
  1211. XWizards don't need money to do anything.
  1212. X
  1213. XROBBERY:
  1214. XWhen you rob someone, you succeed or fail to use them (See SUCCESS and
  1215. XFAILURE). You can protect yourself from being robbed by entering "@lock me=me"
  1216. X(See ME, and, @lock). If you lock yourself to yourself, you
  1217. Xcan rob yourself and set off your @success and @osuccess messages. Try
  1218. Xentering "@osucc me=is goofy." and robbing yourself in a crowd. (See rob).
  1219. X
  1220. XSACRIFICING:
  1221. XYou sacrifice a thing by dropping it in the temple. Sacrificing an object
  1222. Xgives you the value of an object. You can't sacrifice something you own.
  1223. XIf you have >= 10000 pennies, all sacrifices are worth only 1 penny. The 
  1224. Xsacrifice value of a thing is set at creation by "@create frob=cost", by 
  1225. Xthe formula value=(cost/5)-1. Only a wizard can change the value of an 
  1226. Xobject, once created.
  1227. X
  1228. XSTRINGS:
  1229. XObjects have 8 strings: 1) a name. 2) a description. 3) a success message
  1230. X(seen by the player). 4) a fail message (seen by the player). 5) an 
  1231. Xosuccess message (seen by others). 6) an ofail message (seen by others).
  1232. X7) a drop message (seen by the player). 8) a odrop message (seen by others).
  1233. X
  1234. XSUBSTITUTIONS:
  1235. X@osuccess and @ofail messages may contain %-substitutions, which evaluate to
  1236. Xgender-specific pronouns if the player's gender is set. They are: %s
  1237. X(subjective) = Name, he, she, it. %o (objective) = Name, him, her, it. %p
  1238. X(possessive) = Name's, his, her, its. %n (player's name) = Name. If you need a 
  1239. X'%', use %%. Ex. '@ofail teapot=burns %p hand on the hot teapot.' (See GENDER).
  1240. XYou can also custom set your own substitutions. For example, '@set me=%o:hir',
  1241. Xwill cause 'hir' to be substituted for %o instead of him, her, or it.
  1242. X
  1243. XSUCCESS:
  1244. XYou successfully use an object when you take it. You use an exit successfully
  1245. Xwhen you go through it. You successfully use a person successfully when you
  1246. Xsuccessfully rob them. You successfully use a room when you look around.
  1247. X
  1248. XTYPES:
  1249. XThere are 4 types of objects: things, players, exits, and rooms. The first
  1250. Xletter following an object's ID number indicates the type: P(layer), E(xit),
  1251. XR(oom), otherwise, thing. Things are inanimate objects that can be carried.
  1252. XPlayers are animate objects that can move and carry. Exits are the means by
  1253. Xwhich objects move. Rooms are locations that contain objects and linked 
  1254. Xexits. (Mind you, MUF programming can write its own rules. You can have
  1255. Xmobile rooms (vehicles) and containers easily.)
  1256. X
  1257. XACTIONS:
  1258. XActions are similar to exits, as you can '@link' them to things, and they can
  1259. Xthen take you places, or bring things to you. Actions can thus be thought of
  1260. Xas moveable exits, as they move with the thing or player that they are attached
  1261. Xto. Actions will always work in the owner's rooms and in rooms with the JUMP_OK
  1262. Xflag (See JUMP_OK) set. Actions attached to a thing always work whenever the 
  1263. Xthing is in the room. Actions attached to a player can only work for the player
  1264. Xthat owns them.
  1265. X
  1266. XLINKING:
  1267. X You can link to something if you control it, or if it is set LINK_OK (or
  1268. XABODE). Being able to link means you can set the homes of objects or yourself
  1269. Xto a room if it is set ABODE, and can set the destination of exits to a room 
  1270. Xif it is LINK_OK. (See LINK_OK and ABODE, and @link).
  1271. X Linking an action/exit to an object means that a successful activation of the
  1272. Xexit will bring the object to you, if the action/exit is attached to you or to
  1273. Xthe room you're in. If that object is with another player, then it disappears
  1274. Xfrom their inventory and is brought to you (either to your inventory, if the
  1275. Xaction/exit is attached to you, or to your room, if it is attached to the
  1276. Xroom).  If the action/exit is attached to a thing, that thing will go home
  1277. Xwhen the action/exit is triggered, unless the action/exit's STICKY flag is
  1278. Xset (See STICKY). In that case, it summons the thing it's linked to as normal.
  1279. XFor example: a sticky exit 'press button' attached to a 'candy machine', linked
  1280. Xto a 'candy bar', summons the candy bar into the room. a 'eat candy' exit 
  1281. Xattached to the 'candy bar', linked to a 'half-eaten candy bar', will summon
  1282. Xthe 'half-eaten candy bar' and remove the 'candy bar'.
  1283. X Linking an action/exit to a player means that a successful activation of the
  1284. Xexit will bring you to the player, if the player has their JUMP_OK flag set.
  1285. X Linking an action/exit to a program allows you to use that program. (without
  1286. Xcarrying it around with you).
  1287. X Linking an action/exit to other actions/exits is a meta-link. (See META-LINKS).
  1288. X
  1289. XMETA-LINKS:
  1290. XWhen a meta-link is triggered, all the exits that it was linked to will be 
  1291. Xtriggered at the same time. As a result, all of those exits will occur, moving
  1292. Xobjects around or many other things. It will not move players to rooms however.
  1293. XFor example, if action/exit 'a' is linked to thing #123, when 'a' is 
  1294. Xtriggered, it summons thing #123. If 'b' is linked to thing #456, when 'b'
  1295. Xis triggered, it summons thing #456. If 'c' is linked to both 'a' and 'b',
  1296. X(with "@link c=a;b"), when 'c' is triggered, *both* 'a' and 'b' will be
  1297. Xtriggered, summoning #123 and #456 at the same time.
  1298. X
  1299. XPROPERTIES:
  1300. XProperty lists (p-lists) are an extension to flags. Each object will have a
  1301. Xp-list that can be checked against in locks and such. p-lists can be anything.
  1302. XTo unset properties use "@set thing=property:". To remove all properties use 
  1303. X"@set thing=:". 
  1304. X
  1305. XMUF:
  1306. XMUF is a FORTH-derived language, in which programs can be written by players
  1307. Xwith the MUCKER flag. Type 'man' to see a terse summary of MUF commands,
  1308. Xor you can ftp the docs from belch.berkeley.edu, in the directory pub/tinymuck.
  1309. X
  1310. XExamples
  1311. X--------
  1312. X
  1313. XIgor is a new player. He sets his description by typing:
  1314. X   @desc me=Igor is a ferret with an evil glint in his eye.
  1315. XHe has guarded himself from being robbed, and set some fail messages on 
  1316. Xhimself that people will see when they try to rob him. He typed:
  1317. X   @lock me=me
  1318. X   @fail me=Igor chomps you on the knee with his little sharp teeth.
  1319. X   @ofail me=howls in pain as Igor bites them.
  1320. XNow, here is what happens if Murf tries to rob Igor:
  1321. X   Murf types:   rob igor
  1322. X   Murf sees:    Igor chomps you on the knee with his little sharp teeth.
  1323. X   all else see: Murf howls in pain as Igor bites them.
  1324. X'them' as a pronoun isn't to specific, and so Igor should do this:
  1325. X   @ofail me=howls in pain as Igor bites %o.
  1326. XSo if Murf robs Igor, this is what everyone else will see:
  1327. X   Murf howls in pain as Igor bites him.
  1328. XThis is assuming that Murf did a '@set me=sex:male'. If not, it would have
  1329. Xprinted:
  1330. X   Murf howls in pain as Igor bites Murf.
  1331. X
  1332. XIgor wants to set a message that he will use a lot, so he sets his @osucc:
  1333. X   @osucc me=runs around the room nipping at everyone's heels.
  1334. XNow, if he wants to display that message:
  1335. X   Igor types:   rob me
  1336. X   Igor sees:    You stole a penny.
  1337. X             Igor stole one of your pennies!
  1338. X   all else see: Igor runs around the room nipping at everyone's heels.
  1339. X
  1340. XIgor wants to make an object called 'Ferret chow'. He types:
  1341. X   @create Ferret Chow
  1342. X   @desc Ferret Chow=This is a big bag full of yummy ferret chow. 
  1343. X   @succ Ferret Chow=You tear into the end of the bag, stuffing yourself.
  1344. X   @osucc Ferret Chow=tears into the Ferret Chow bag, eating greedily.
  1345. XNow Igor decides that he wants to be the only one who can pick up the bag.
  1346. X   @lock Ferret Chow=me
  1347. X   @fail Ferret Chow=It's icky Ferret Chow. It would probably taste gross.
  1348. X   @ofail Ferret Chow=decides Ferret Chow is icky.
  1349. XIf Igor picks up the bag:
  1350. X   Igor types:   get Ferret Chow 
  1351. X   Igor sees:    You tear into the end of the bag, stuffing yourself.
  1352. X   all else see: Igor tears into the Ferret Chow bag, eating greedily.
  1353. XIgor is now carrying the bag. He must drop it if he wants to see the messages
  1354. Xagain.  If Murf picks up the bag:
  1355. X   Murf types:   get Ferret Chow
  1356. X   Murf sees:    It's icky Ferret Chow. It would probably taste gross.
  1357. X   all else see: Murf decides Ferret Chow is icky.
  1358. XBecause the bag was locked to Igor, Murf cannot get the bag.
  1359. X
  1360. XIgor wants to build a few rooms. He can only build off of a place where he
  1361. Xcan get a link. He needs to ask around to find one of these if he is just
  1362. Xstarting to build. Murf is going to give Igor a link named 'n;north'. That
  1363. Xmeans that both 'n' and 'north' activate that exit. Igor digs a room, and
  1364. Xlinks the exit to it. He types:
  1365. X   @dig Igor's House
  1366. XAt this point, the program will respond "Igor's House created with room number 
  1367. Xxxxx". We'll pretend it gave the room number as 1234.
  1368. X   @link n;north=1234
  1369. XThe program will respond with "Linked." Now Igor sets a few messages on the
  1370. Xexit. He types:
  1371. X   @desc n=North is Igor's House.
  1372. X   @succ n=You crawl into Igor's House.
  1373. X   @osucc n=crawls into Igor's House.
  1374. XThese messages work just the same way they work on object, like the Ferret Chow.
  1375. XNext, Igor goes in the room, and creates an out exit. Murf has been nice enough
  1376. Xto not only give Igor the n;north exit, but to set his room to L(ink_ok). Murf's
  1377. Xroom number is 623.  Igor types 'n' or 'north' to go in the room, then types:
  1378. X   @open out;back;s;south=623
  1379. XThe program will respond with "Opened. Trying to link... Linked." Igor now
  1380. Xhas a south exit back to Murf's room. Murf can now set his room to !link_ok,
  1381. Xso no one else can link to it. Igor puts some messages on the south link as
  1382. Xwell. He decides he wants to describe the room, so he types:
  1383. X   @desc here=This is Igor's home. It is a small room, lined with paper shreds.
  1384. X   Over in the corner is a small hole.
  1385. XNow Igor wants to dig a small room that the hole connects to. He types:
  1386. X   @dig Igor's Hidden Room
  1387. XThe program tells him that the room is number 1250. He then types:
  1388. X   @open hole=1250
  1389. X   @lock hole=me
  1390. X   @desc hole=This is a small hole, just the size of Igor.
  1391. X   @fail hole=You can't fit.
  1392. X   @ofail hole=can't fit through the hole.
  1393. X   @succ hole=You slip into the hole.
  1394. X   @osucc hole=slips into the hole.
  1395. XThis creates and links the exit called 'hole' to Igor's Hidden Room. He locks
  1396. Xthe exit to him, so only he can go through the exit. When he uses the exit,
  1397. Xthe success and osuccess messages will be displayed. When someone else tries to
  1398. Xuse the exit, the fail and ofail messages will be displayed. Since Igor owned
  1399. Xthe room that he was linking from, he had to use @open to create the link first.
  1400. XHe now types 'hole' to go in the room, and types '@open out=1234' to create
  1401. Xand link an exit called 'out' that leads to his House. 
  1402. XIf Igor wants everyone BUT Murf to be able to go 'hole', he types:
  1403. X   @lock hole=!*murf
  1404. XThis locks the hole against the player Murf. If he wants a person to be able to
  1405. Xgo through 'hole' only if they have the bag of Ferret Chow, he types:
  1406. X   @lock hole=Ferret Chow
  1407. XIf he wants himself to be able to go in the hole, even if he doesn't have the
  1408. XFerret Chow, he types:
  1409. X   @lock hole=Ferret Chow | me
  1410. XIf he wants to lock everyone out except for himself and Murf if Murf has the bag
  1411. Xof Ferret Chow, he types:
  1412. X   @lock hole=(*murf & Ferret Chow) | me
  1413. XYou can get more and more complicated with locks this way.
  1414. XIgor is done building his home, and wants to set his home to it, so when he
  1415. Xtypes 'home' he will go there instead of Limbo(#0RDLA). He goes in his house,
  1416. Xand types:
  1417. X   @link me=here
  1418. XThe program will respond with "Home set." Now Igor can go 'home', and QUIT
  1419. Xand not worry about his inactive body cluttering up the landscape.
  1420. X
  1421. XCreating whole houses and adventures can be easy if you understand the way
  1422. Xthe @ commands work.
  1423. XWhen you build a room, it makes it neater if you have a very thorough
  1424. Xdescription. Every thing listed in the description can be given a bogus
  1425. Xexit (see entry) to detail the place. For example, here is the description 
  1426. Xof a room built by Three.
  1427. X
  1428. X   Three's flat(#5400)
  1429. X   Red wall-to-wall carpeting covers the floor. A cushy brown leather
  1430. X   couch sits across from a wide-screen TV with a VCR and video disc
  1431. X   player stacked on top.  Escher prints hang on the walls, hilited by
  1432. X   track lighting. Papers protrude from a roll-top desk to one side,
  1433. X   adjoining an imposing stereo whose controls rival those of 747 cockpits.
  1434. X   The kitchen lies north, the foyer south, and the bedroom beyond a
  1435. X   short passage east.
  1436. X   Contents:
  1437. X   Flitterby Award for Comprehensive Building
  1438. X
  1439. XNow, you noticed the desk in the room. A 'look desk' will show:
  1440. X   Every drawer and cubby is overflowing with papers, envelopes, flyers,
  1441. X   leaflets, folders, booklets, binders, quick reference cards, and
  1442. X   other paper products. A Compaq luggable sits in a small canyon of
  1443. X   paper. Atop the desk stands a framed photo. Under the desk sits a
  1444. X   back stool.
  1445. XNow, since this was done with a exit to create a bogus command, you might
  1446. Xtry going through the exit, so you will get the fail message. A 'desk' will
  1447. Xshow:
  1448. X   You rummage thru the desk drawers, finding nothing of interest.
  1449. XHere is an examine of the bogus command, to show you how it was done (only
  1450. Xthe owner or a WIZARD can do an examine and get this output):
  1451. X   desk(#5395E)
  1452. X   Owner: Three  Key: Three(#5370PTF)&!Three(#5370PTF) Pennies: 0
  1453. X   Every drawer and cubby is overflowing with papers, envelopes, flyers,
  1454. X   leaflets, folders, booklets, binders, quick reference cards, and
  1455. X   other paper products. A Compaq luggable sits in a small canyon of
  1456. X   paper. Atop the desk stands a framed photo. Under the desk sits a
  1457. X   back stool.
  1458. X   Fail: You rummage thru the desk drawers, finding nothing of interest.
  1459. X   Ofail: rummages thru the desk drawers.
  1460. X   Destination: Three's flat(#5400R)
  1461. X
  1462. XIn this way, a highly detailed room can be built, and greatly increase the
  1463. Xatmosphere of the place. Take a walk around and look at the place first, 
  1464. Xbefore deciding to build. Then sit down and think carefully about what you
  1465. Xwant to build. Careful planning has made several very interesting places.
  1466. X
  1467. END_OF_FILE
  1468. if test 33769 -ne `wc -c <'tiny.docs'`; then
  1469.     echo shar: \"'tiny.docs'\" unpacked with wrong size!
  1470. fi
  1471. # end of 'tiny.docs'
  1472. fi
  1473. echo shar: End of archive 6 \(of 10\).
  1474. cp /dev/null ark6isdone
  1475. MISSING=""
  1476. for I in 1 2 3 4 5 6 7 8 9 10 ; do
  1477.     if test ! -f ark${I}isdone ; then
  1478.     MISSING="${MISSING} ${I}"
  1479.     fi
  1480. done
  1481. if test "${MISSING}" = "" ; then
  1482.     echo You have unpacked all 10 archives.
  1483.     echo ">>> now type 'sh joinspl.sh'"
  1484.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1485. else
  1486.     echo You still need to unpack the following archives:
  1487.     echo "        " ${MISSING}
  1488. fi
  1489. ##  End of shell archive.
  1490. exit 0
  1491.